<div>
  <el-button @click="showAddGoodsDialog" type="success" plain>添加分类</el-button>
  <!-- 商品列表 -->
  <el-table :data="goodsList" style="width: 100%" v-loading="isLoading">
    <el-table-tree-column :indentSize="40" level-key="cat_level" parent-key="cat_pid" tree-key="cat_id" file-icon="icon icon-file"
      folder-icon="icon icon-folder" prop="cat_name" label="分类名称" width="220"></el-table-tree-column>
    <!-- <el-table-column prop="cat_name" label="分类名称" width="180">
    </el-table-column> -->
    <el-table-column prop="cat_deleted" label="是否有效" width="180">
      <template slot-scope="{row}">
        <span v-if="row.cat_deleted">true</span>
        <span v-else>false</span>
      </template>
    </el-table-column>
    <el-table-column prop="cat_level" label="排序">
    </el-table-column>
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button plain size="mini" type="primary" icon="el-icon-edit"></el-button>
        <el-button plain size="mini" type="danger" icon="el-icon-delete"></el-button>
      </template>
    </el-table-column>
  </el-table>
  <!-- 分页 -->
  <el-pagination @current-change="pageChange" background layout="prev, pager, next" :total="total" :page-size="pagesize">
  </el-pagination>
  <!-- 添加商品对话框 -->
  <el-dialog title="添加分类" :visible.sync="isShowAddGoodsDialog">
    <el-form :model="addGoodsForm">
      <el-form-item label="分类名称" label-width="120px">
        <el-input v-model="addGoodsForm.cat_name"></el-input>
      </el-form-item>
      <el-form-item label="父类名称" label-width="120px">
        <el-cascader v-model="addGoodsForm.addGoodsSelected" :options="goodsListLevel2" :props="props" change-on-select></el-cascader>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="isShowAddGoodsDialog = false">取 消</el-button>
      <el-button type="primary" @click="addGoods">确 定</el-button>
    </div>
  </el-dialog>
  <xxh-test :is-not="isNot" @submit="handleSunmit"></xxh-test>
</div>